package com.yimi.yinhepda.adapter.RecycleAdapter

import android.content.Context
import com.yimi.yinhepda.R
import com.pda.ym.base.CommonRecycleAdapter
import com.pda.ym.base.CommonViewHolder
import com.yimi.yinhepda.entity.bean.KuaYueChildWaybillEntitiy

/**
 * @author: lj
 * Date: 2020/3/9 14:28
 * Description:跨越运单扫描信息列表适配器
 */
class KuaYueWaybillScanInfoAdapter(var context: Context?, dataList: MutableList<KuaYueChildWaybillEntitiy>?)
    : CommonRecycleAdapter<KuaYueChildWaybillEntitiy>(context, dataList, R.layout.item_kuayue_waybill_scan_info) {

    override fun bindData(holder: CommonViewHolder?, data: KuaYueChildWaybillEntitiy?, position: Int) {
        holder?.setText(R.id.tv_ym_childbill, data?.subWaybillNo)
        holder?.setText(R.id.tv_ky_childbill, data?.subOutsideNo)
        if (data?.flag == 1) {
            holder!!.itemView.setBackgroundColor(context!!.resources.getColor(R.color.green))
        } else {
            holder!!.itemView.setBackgroundColor(context!!.resources.getColor(R.color.red))
        }
    }
}